<template>
  <div id="app">
    <transition :name="name">
      <router-view class="child-view"></router-view>
    </transition>
  </div>
</template>

<script>
  export default {
    name: 'app',
    computed:{
      name(){
        let transition = this.$store.state.app.transition;
        return 'slide-'+transition
      }
    }
  }
</script>

<style lang="less">
  @import '../vux/src/styles/reset.less';

  body {
    background-color: #fbf9fe;
  }

  .child-view {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    transition: all .6s cubic-bezier(.55, 0, .1, 1);
  }

  .slide-left-enter,
  .slide-right-leave-active {
    opacity: 0;
    -webkit-transform: translate(100%, 0);
    transform: translate(100%, 0);
  }

  .slide-left-leave-active,
  .slide-right-enter {
    opacity: 0;
    -webkit-transform: translate(-100%, 0);
    transform: translate(-100% 0);
  }
</style>
